<div class="module-personal-menu">
    <div class="common-box">
        <h2 class="title">Trang cá nhân</h2>
        <div class="box-content">
            <div class="lst-options">
                <ul>
                    <li><a href="{$WEB_DIR}usercp.html" id="cpanel">Cá nhân</a></li>
                    <li><a href="{$WEB_DIR}mybooked.html" id="mybooked">Book List</a></li>
                    <li><a href="{$WEB_DIR}usercp.html?cmd=change_pass" id="change_pass">Đổi mật khẩu</a></li>
                </ul>
            </div><!--end: div.lst-options -->
        </div>
    </div>
</div>

{if $admin}
<div class="module-personal-menu" style="padding-top: 12px;">
    <div class="common-box">
        <h2 class="title">Trang quản trị</h2>
        <div class="box-content">
            <div class="lst-options">
                <ul>
                    <li><a href="{$WEB_DIR}pmanage_board.html" id="dashboard">Dashboard</a></li>
                    <li><a href="{$WEB_DIR}manage_hotel_provider.html" id="hotel_provider">Khách sạn
                        {if $hotel_admin}{if $num and $num > 0}({$num}){/if}{/if}
                        </a>
                    </li>
                    {*<li><a href="{$WEB_DIR}pmanage_policy.html">Quản trị chính sách khách sạn</a></li>*}
                    <li><a href="{$WEB_DIR}pmanage_promotion_hotel.html" id="hotel_promotion">Khuyến mãi khách sạn</a></li>
                    <li><a href="{$WEB_DIR}pmanage_deal_hotel.html" id="hotel_deal">Deal khách sạn</a></li>
                    {*<li><a href="{$WEB_DIR}pmanage_hotel_filter.html">Quản trị Thuộc tính khách sạn</a></li>
                    <li><a href="{$WEB_DIR}pmanage_room_filter.html">Quản trị Thuộc tính phòng</a></li>*}
                    <li><a href="{$WEB_DIR}pmanage_policy.html" id="hotel_policy">Chính sách hoàn hủy</a></li>
                    <li>
                        <a href="{$WEB_DIR}pmanage_cart.html" id="cart_provider">Đơn hàng
                            {if $hotel_admin}{if $cart and $cart > 0}({$cart}){/if}{/if}
                        </a>
                    </li>
                    <li><a href="{$WEB_DIR}pmanage_deal_cart.html" id="deal_cart_provider">Đơn hàng deal
                        {if $hotel_admin}{if $deal_cart and $deal_cart > 0}({$deal_cart}){/if}{/if}
                        </a>
                    </li>
                </ul>
            </div><!--end: div.lst-options -->
        </div>
    </div>
</div>
{/if}
{literal}
    <script type="text/javascript">
        //Set active label
    var purl = window.location.href.split('/');
    var acurl = purl[3].split('?');
    var cpanel = $("#cpanel");
    var mybooked = $("#mybooked");
    var change_pass = $("#change_pass");
    var dashboard = $("#dashboard");
    var hotel_provider = $("#hotel_provider");
    var hotel_promotion = $("#hotel_promotion");
    var hotel_deal = $("#hotel_deal");
    var cart_provider = $("#cart_provider");
    var deal_cart_provider = $("#deal_cart_provider");
    var hotel_policy = $("#hotel_policy");
    
    switch (acurl['0']){
        case 'cmd=change_pass':
            removeActiveHeader(change_pass);
            break;
        case 'usercp.html':
            removeActiveHeader(cpanel);
            break;
        case 'pmanage_policy.html':
            removeActiveHeader(hotel_policy);
            break;
        case 'mybooked.html':
            removeActiveHeader(mybooked);
            break;
        case 'pmanage_board.html':
            removeActiveHeader(dashboard);
            break;
        case 'manage_hotel_provider.html':
            removeActiveHeader(hotel_provider);
            break;
        case 'pmanage_promotion_hotel.html':
            removeActiveHeader(hotel_promotion);
            break;
        case 'pmanage_deal_hotel.html':
            removeActiveHeader(hotel_deal);
            break;
        case 'pmanage_cart.html':
            removeActiveHeader(cart_provider);
            break;
        case 'pmanage_deal_cart.html':
            removeActiveHeader(deal_cart_provider);
            break;
        case 'pmanage_room.html':
            removeActiveHeader(hotel_provider);
            break;
        case 'pmanage_room_status.html':
            removeActiveHeader(hotel_provider);
            break;
        case 'pmanage_hotel_review.html':
            removeActiveHeader(hotel_provider);
            break;
    }
    if(acurl['0'] == 'usercp.html' && acurl['1'] == 'cmd=change_pass')
        removeActiveHeader(change_pass);
    function removeActiveHeader(e){
        $(".module-personal-menu").find("a.active").removeClass("active");
        e.addClass("active");
    }

        
    </script>
    {/literal}